/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import org.netbeans.microedition.lcdui.SplashScreen;

/**
 * @author mbdp
 */
public class VisualMIDlet extends MIDlet implements CommandListener {

    private boolean midletPaused = false;
    private HideToThrowCanvas canvas;
    private Display display;
    private int language = 0;// 0 - havent select language yet
    private int screenNumber;
    //<editor-fold defaultstate="collapsed" desc=" Generated Fields ">//GEN-BEGIN:|fields|0|
    private SplashScreen startUp;
    private Form selectLanguage;
    private ImageItem imageItem;
    private Form enableSoundEng;
    private ImageItem imageItem1;
    private Form enableSoundSpan;
    private ImageItem imageItem2;
    private Form enableSoundPortu;
    private ImageItem imageItem4;
    private Form enableSoundChinese;
    private ImageItem imageItem3;
    private Form Menu;
    private Form howToPlay2;
    private ImageItem imageItem6;
    private Form howToPlay;
    private ImageItem imageItem5;
    private Form MenuSpan;
    private Form howToPlayPortu;
    private Form MenuPortu;
    private Form MenuChinese;
    private Form howToPlayChinese2;
    private Form howToPlaySpan;
    private Form howToPlayPortu2;
    private Form howToPlayChinese;
    private Form howToPlaySpan2;
    private Image image1;
    //</editor-fold>//GEN-END:|fields|0|

    /**
     * The VisualMIDlet constructor.
     */
    public VisualMIDlet() {
        screenNumber = 0;
        canvas = new HideToThrowCanvas();
        display = Display.getDisplay(this);

    }

    public void destroyApp(boolean unconditional) {
    }

    public void pauseApp() {
        midletPaused = true;
    }

    public void startApp() {
        if (midletPaused) {
            resumeMIDlet();
        } else {
            initialize();
            startMIDlet();
        }
        midletPaused = false;
    }

    //<editor-fold defaultstate="collapsed" desc=" Generated Methods ">//GEN-BEGIN:|methods|0|
    //</editor-fold>//GEN-END:|methods|0|
    //<editor-fold defaultstate="collapsed" desc=" Generated Method: initialize ">//GEN-BEGIN:|0-initialize|0|0-preInitialize
    /**
     * Initilizes the application.
     * It is called only once when the MIDlet is started. The method is called before the <code>startMIDlet</code> method.
     */
    private void initialize() {//GEN-END:|0-initialize|0|0-preInitialize
        // write pre-initialize user code here
//GEN-LINE:|0-initialize|1|0-postInitialize
        // write post-initialize user code here
    }//GEN-BEGIN:|0-initialize|2|
    //</editor-fold>//GEN-END:|0-initialize|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: startMIDlet ">//GEN-BEGIN:|3-startMIDlet|0|3-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Started point.
     */
    public void startMIDlet() {//GEN-END:|3-startMIDlet|0|3-preAction
        // write pre-action user code here
        switchDisplayable(null, getStartUp());//GEN-LINE:|3-startMIDlet|1|3-postAction
        // write post-action user code here
    }//GEN-BEGIN:|3-startMIDlet|2|
    //</editor-fold>//GEN-END:|3-startMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: resumeMIDlet ">//GEN-BEGIN:|4-resumeMIDlet|0|4-preAction
    /**
     * Performs an action assigned to the Mobile Device - MIDlet Resumed point.
     */
    public void resumeMIDlet() {//GEN-END:|4-resumeMIDlet|0|4-preAction
        // write pre-action user code here
//GEN-LINE:|4-resumeMIDlet|1|4-postAction
        // write post-action user code here
    }//GEN-BEGIN:|4-resumeMIDlet|2|
    //</editor-fold>//GEN-END:|4-resumeMIDlet|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: switchDisplayable ">//GEN-BEGIN:|5-switchDisplayable|0|5-preSwitch
    /**
     * Switches a current displayable in a display. The <code>display</code> instance is taken from <code>getDisplay</code> method. This method is used by all actions in the design for switching displayable.
     * @param alert the Alert which is temporarily set to the display; if <code>null</code>, then <code>nextDisplayable</code> is set immediately
     * @param nextDisplayable the Displayable to be set
     */
    public void switchDisplayable(Alert alert, Displayable nextDisplayable) {//GEN-END:|5-switchDisplayable|0|5-preSwitch
        // write pre-switch user code here
        Display display = getDisplay();//GEN-BEGIN:|5-switchDisplayable|1|5-postSwitch
        if (alert == null) {
            display.setCurrent(nextDisplayable);
        } else {
            display.setCurrent(alert, nextDisplayable);
        }//GEN-END:|5-switchDisplayable|1|5-postSwitch
        // write post-switch user code here
    }//GEN-BEGIN:|5-switchDisplayable|2|
    //</editor-fold>//GEN-END:|5-switchDisplayable|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Method: commandAction for Displayables ">//GEN-BEGIN:|7-commandAction|0|7-preCommandAction
    /**
     * Called by a system to indicated that a command has been invoked on a particular displayable.
     * @param command the Command that was invoked
     * @param displayable the Displayable where the command was invoked
     */
    public void commandAction(Command command, Displayable displayable) {//GEN-END:|7-commandAction|0|7-preCommandAction
        // write pre-action user code here
        if (displayable == startUp) {//GEN-BEGIN:|7-commandAction|1|16-preAction
            if (command == SplashScreen.DISMISS_COMMAND) {//GEN-END:|7-commandAction|1|16-preAction
                // write pre-action user code here
                display.setCurrent(canvas);
                screenNumber = 1;
                switchDisplayable(null, getSelectLanguage());
                display.setCurrent(canvas);
//GEN-LINE:|7-commandAction|2|16-postAction
                // write post-action user code here
            }//GEN-BEGIN:|7-commandAction|3|7-postCommandAction
        }//GEN-END:|7-commandAction|3|7-postCommandAction
        // write post-action user code here
    }//GEN-BEGIN:|7-commandAction|4|
    //</editor-fold>//GEN-END:|7-commandAction|4|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: startUp ">//GEN-BEGIN:|14-getter|0|14-preInit
    /**
     * Returns an initiliazed instance of startUp component.
     * @return the initialized component instance
     */
    public SplashScreen getStartUp() {
        if (startUp == null) {//GEN-END:|14-getter|0|14-preInit

            // write pre-init user code here
            startUp = new SplashScreen(getDisplay());//GEN-BEGIN:|14-getter|1|14-postInit
            startUp.setTitle("Welcome to Hide To Throw Game!");
            startUp.setCommandListener(this);
            startUp.setImage(getImage1());
            startUp.setTimeout(3000);//GEN-END:|14-getter|1|14-postInit
            // write post-init user code here
        }//GEN-BEGIN:|14-getter|2|
        return startUp;
    }
    //</editor-fold>//GEN-END:|14-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: selectLanguage ">//GEN-BEGIN:|17-getter|0|17-preInit
    /**
     * Returns an initiliazed instance of selectLanguage component.
     * @return the initialized component instance
     */
    public Form getSelectLanguage() {
        if (selectLanguage == null) {//GEN-END:|17-getter|0|17-preInit
            // write pre-init user code here
            selectLanguage = new Form("Select Langauge", new Item[] { getImageItem() });//GEN-LINE:|17-getter|1|17-postInit
            // write post-init user code here
        }//GEN-BEGIN:|17-getter|2|
        return selectLanguage;
    }
    //</editor-fold>//GEN-END:|17-getter|2|
    //</editor-fold>

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: enableSoundEng ">//GEN-BEGIN:|18-getter|0|18-preInit
    /**
     * Returns an initiliazed instance of enableSoundEng component.
     * @return the initialized component instance
     */
    public Form getEnableSoundEng() {
        if (enableSoundEng == null) {//GEN-END:|18-getter|0|18-preInit
            // write pre-init user code here
            enableSoundEng = new Form("form", new Item[] { getImageItem1() });//GEN-LINE:|18-getter|1|18-postInit
            // write post-init user code here
        }//GEN-BEGIN:|18-getter|2|
        return enableSoundEng;
    }
    //</editor-fold>//GEN-END:|18-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: image1 ">//GEN-BEGIN:|20-getter|0|20-preInit
    /**
     * Returns an initiliazed instance of image1 component.
     * @return the initialized component instance
     */
    public Image getImage1() {
        if (image1 == null) {//GEN-END:|20-getter|0|20-preInit
            // write pre-init user code here
            try {//GEN-BEGIN:|20-getter|1|20-@java.io.IOException
                image1 = Image.createImage("/background.jpg");
            } catch (java.io.IOException e) {//GEN-END:|20-getter|1|20-@java.io.IOException
                e.printStackTrace();
            }//GEN-LINE:|20-getter|2|20-postInit
            // write post-init user code here
        }//GEN-BEGIN:|20-getter|3|
        return image1;
    }
    //</editor-fold>//GEN-END:|20-getter|3|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem ">//GEN-BEGIN:|21-getter|0|21-preInit
    /**
     * Returns an initiliazed instance of imageItem component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem() {
        if (imageItem == null) {//GEN-END:|21-getter|0|21-preInit
            // write pre-init user code here
            imageItem = new ImageItem("", getImage1(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER, "<Missing Image>", Item.PLAIN);//GEN-LINE:|21-getter|1|21-postInit
            // write post-init user code here
        }//GEN-BEGIN:|21-getter|2|
        return imageItem;
    }
    //</editor-fold>//GEN-END:|21-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem1 ">//GEN-BEGIN:|22-getter|0|22-preInit
    /**
     * Returns an initiliazed instance of imageItem1 component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem1() {
        if (imageItem1 == null) {//GEN-END:|22-getter|0|22-preInit
            // write pre-init user code here
            imageItem1 = new ImageItem("", getImage1(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER, "<Missing Image>");//GEN-LINE:|22-getter|1|22-postInit
            // write post-init user code here
        }//GEN-BEGIN:|22-getter|2|
        return imageItem1;
    }
    //</editor-fold>//GEN-END:|22-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: enableSoundSpan ">//GEN-BEGIN:|23-getter|0|23-preInit
    /**
     * Returns an initiliazed instance of enableSoundSpan component.
     * @return the initialized component instance
     */
    public Form getEnableSoundSpan() {
        if (enableSoundSpan == null) {//GEN-END:|23-getter|0|23-preInit
            // write pre-init user code here
            enableSoundSpan = new Form("form", new Item[] { getImageItem2() });//GEN-LINE:|23-getter|1|23-postInit
            // write post-init user code here
        }//GEN-BEGIN:|23-getter|2|
        return enableSoundSpan;
    }
    //</editor-fold>//GEN-END:|23-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: enableSoundChinese ">//GEN-BEGIN:|24-getter|0|24-preInit
    /**
     * Returns an initiliazed instance of enableSoundChinese component.
     * @return the initialized component instance
     */
    public Form getEnableSoundChinese() {
        if (enableSoundChinese == null) {//GEN-END:|24-getter|0|24-preInit
            // write pre-init user code here
            enableSoundChinese = new Form("form", new Item[] { getImageItem3() });//GEN-LINE:|24-getter|1|24-postInit
            // write post-init user code here
        }//GEN-BEGIN:|24-getter|2|
        return enableSoundChinese;
    }
    //</editor-fold>//GEN-END:|24-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: enableSoundPortu ">//GEN-BEGIN:|25-getter|0|25-preInit
    /**
     * Returns an initiliazed instance of enableSoundPortu component.
     * @return the initialized component instance
     */
    public Form getEnableSoundPortu() {
        if (enableSoundPortu == null) {//GEN-END:|25-getter|0|25-preInit
            // write pre-init user code here
            enableSoundPortu = new Form("form", new Item[] { getImageItem4() });//GEN-LINE:|25-getter|1|25-postInit
            // write post-init user code here
        }//GEN-BEGIN:|25-getter|2|
        return enableSoundPortu;
    }
    //</editor-fold>//GEN-END:|25-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem2 ">//GEN-BEGIN:|26-getter|0|26-preInit
    /**
     * Returns an initiliazed instance of imageItem2 component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem2() {
        if (imageItem2 == null) {//GEN-END:|26-getter|0|26-preInit
            // write pre-init user code here
            imageItem2 = new ImageItem("", getImage1(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER, "<Missing Image>");//GEN-LINE:|26-getter|1|26-postInit
            // write post-init user code here
        }//GEN-BEGIN:|26-getter|2|
        return imageItem2;
    }
    //</editor-fold>//GEN-END:|26-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem3 ">//GEN-BEGIN:|27-getter|0|27-preInit
    /**
     * Returns an initiliazed instance of imageItem3 component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem3() {
        if (imageItem3 == null) {//GEN-END:|27-getter|0|27-preInit
            // write pre-init user code here
            imageItem3 = new ImageItem("", getImage1(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER, "<Missing Image>");//GEN-LINE:|27-getter|1|27-postInit
            // write post-init user code here
        }//GEN-BEGIN:|27-getter|2|
        return imageItem3;
    }
    //</editor-fold>//GEN-END:|27-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem4 ">//GEN-BEGIN:|28-getter|0|28-preInit
    /**
     * Returns an initiliazed instance of imageItem4 component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem4() {
        if (imageItem4 == null) {//GEN-END:|28-getter|0|28-preInit
            // write pre-init user code here
            imageItem4 = new ImageItem("", getImage1(), ImageItem.LAYOUT_CENTER | Item.LAYOUT_TOP | Item.LAYOUT_BOTTOM | Item.LAYOUT_VCENTER, "<Missing Image>");//GEN-LINE:|28-getter|1|28-postInit
            // write post-init user code here
        }//GEN-BEGIN:|28-getter|2|
        return imageItem4;
    }
    //</editor-fold>//GEN-END:|28-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: Menu ">//GEN-BEGIN:|31-getter|0|31-preInit
    /**
     * Returns an initiliazed instance of Menu component.
     * @return the initialized component instance
     */
    public Form getMenu() {
        if (Menu == null) {//GEN-END:|31-getter|0|31-preInit
            // write pre-init user code here
            Menu = new Form("form");//GEN-LINE:|31-getter|1|31-postInit
            // write post-init user code here
        }//GEN-BEGIN:|31-getter|2|
        return Menu;
    }
    //</editor-fold>//GEN-END:|31-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlay ">//GEN-BEGIN:|32-getter|0|32-preInit
    /**
     * Returns an initiliazed instance of howToPlay component.
     * @return the initialized component instance
     */
    public Form getHowToPlay() {
        if (howToPlay == null) {//GEN-END:|32-getter|0|32-preInit
            // write pre-init user code here
            howToPlay = new Form("Instructions", new Item[] { getImageItem5() });//GEN-LINE:|32-getter|1|32-postInit
            // write post-init user code here
        }//GEN-BEGIN:|32-getter|2|
        return howToPlay;
    }
    //</editor-fold>//GEN-END:|32-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem5 ">//GEN-BEGIN:|33-getter|0|33-preInit
    /**
     * Returns an initiliazed instance of imageItem5 component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem5() {
        if (imageItem5 == null) {//GEN-END:|33-getter|0|33-preInit
            // write pre-init user code here
            imageItem5 = new ImageItem("", getImage1(), ImageItem.LAYOUT_DEFAULT, "<Missing Image>");//GEN-LINE:|33-getter|1|33-postInit
            // write post-init user code here
        }//GEN-BEGIN:|33-getter|2|
        return imageItem5;
    }
    //</editor-fold>//GEN-END:|33-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlay2 ">//GEN-BEGIN:|34-getter|0|34-preInit
    /**
     * Returns an initiliazed instance of howToPlay2 component.
     * @return the initialized component instance
     */
    public Form getHowToPlay2() {
        if (howToPlay2 == null) {//GEN-END:|34-getter|0|34-preInit
            // write pre-init user code here
            howToPlay2 = new Form("form", new Item[] { getImageItem6() });//GEN-LINE:|34-getter|1|34-postInit
            // write post-init user code here
        }//GEN-BEGIN:|34-getter|2|
        return howToPlay2;
    }
    //</editor-fold>//GEN-END:|34-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: imageItem6 ">//GEN-BEGIN:|35-getter|0|35-preInit
    /**
     * Returns an initiliazed instance of imageItem6 component.
     * @return the initialized component instance
     */
    public ImageItem getImageItem6() {
        if (imageItem6 == null) {//GEN-END:|35-getter|0|35-preInit
            // write pre-init user code here
            imageItem6 = new ImageItem("", getImage1(), ImageItem.LAYOUT_DEFAULT, "<Missing Image>");//GEN-LINE:|35-getter|1|35-postInit
            // write post-init user code here
        }//GEN-BEGIN:|35-getter|2|
        return imageItem6;
    }
    //</editor-fold>//GEN-END:|35-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: MenuPortu ">//GEN-BEGIN:|36-getter|0|36-preInit
    /**
     * Returns an initiliazed instance of MenuPortu component.
     * @return the initialized component instance
     */
    public Form getMenuPortu() {
        if (MenuPortu == null) {//GEN-END:|36-getter|0|36-preInit
            // write pre-init user code here
            MenuPortu = new Form("form", new Item[] { });//GEN-LINE:|36-getter|1|36-postInit
            // write post-init user code here
        }//GEN-BEGIN:|36-getter|2|
        return MenuPortu;
    }
    //</editor-fold>//GEN-END:|36-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: MenuChinese ">//GEN-BEGIN:|37-getter|0|37-preInit
    /**
     * Returns an initiliazed instance of MenuChinese component.
     * @return the initialized component instance
     */
    public Form getMenuChinese() {
        if (MenuChinese == null) {//GEN-END:|37-getter|0|37-preInit
            // write pre-init user code here
            MenuChinese = new Form("form");//GEN-LINE:|37-getter|1|37-postInit
            // write post-init user code here
        }//GEN-BEGIN:|37-getter|2|
        return MenuChinese;
    }
    //</editor-fold>//GEN-END:|37-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: MenuSpan ">//GEN-BEGIN:|38-getter|0|38-preInit
    /**
     * Returns an initiliazed instance of MenuSpan component.
     * @return the initialized component instance
     */
    public Form getMenuSpan() {
        if (MenuSpan == null) {//GEN-END:|38-getter|0|38-preInit
            // write pre-init user code here
            MenuSpan = new Form("form");//GEN-LINE:|38-getter|1|38-postInit
            // write post-init user code here
        }//GEN-BEGIN:|38-getter|2|
        return MenuSpan;
    }
    //</editor-fold>//GEN-END:|38-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlayPortu ">//GEN-BEGIN:|39-getter|0|39-preInit
    /**
     * Returns an initiliazed instance of howToPlayPortu component.
     * @return the initialized component instance
     */
    public Form getHowToPlayPortu() {
        if (howToPlayPortu == null) {//GEN-END:|39-getter|0|39-preInit
            // write pre-init user code here
            howToPlayPortu = new Form("form");//GEN-LINE:|39-getter|1|39-postInit
            // write post-init user code here
        }//GEN-BEGIN:|39-getter|2|
        return howToPlayPortu;
    }
    //</editor-fold>//GEN-END:|39-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlayPortu2 ">//GEN-BEGIN:|40-getter|0|40-preInit
    /**
     * Returns an initiliazed instance of howToPlayPortu2 component.
     * @return the initialized component instance
     */
    public Form getHowToPlayPortu2() {
        if (howToPlayPortu2 == null) {//GEN-END:|40-getter|0|40-preInit
            // write pre-init user code here
            howToPlayPortu2 = new Form("form");//GEN-LINE:|40-getter|1|40-postInit
            // write post-init user code here
        }//GEN-BEGIN:|40-getter|2|
        return howToPlayPortu2;
    }
    //</editor-fold>//GEN-END:|40-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlayChinese ">//GEN-BEGIN:|41-getter|0|41-preInit
    /**
     * Returns an initiliazed instance of howToPlayChinese component.
     * @return the initialized component instance
     */
    public Form getHowToPlayChinese() {
        if (howToPlayChinese == null) {//GEN-END:|41-getter|0|41-preInit
            // write pre-init user code here
            howToPlayChinese = new Form("form");//GEN-LINE:|41-getter|1|41-postInit
            // write post-init user code here
        }//GEN-BEGIN:|41-getter|2|
        return howToPlayChinese;
    }
    //</editor-fold>//GEN-END:|41-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlayChinese2 ">//GEN-BEGIN:|42-getter|0|42-preInit
    /**
     * Returns an initiliazed instance of howToPlayChinese2 component.
     * @return the initialized component instance
     */
    public Form getHowToPlayChinese2() {
        if (howToPlayChinese2 == null) {//GEN-END:|42-getter|0|42-preInit
            // write pre-init user code here
            howToPlayChinese2 = new Form("form");//GEN-LINE:|42-getter|1|42-postInit
            // write post-init user code here
        }//GEN-BEGIN:|42-getter|2|
        return howToPlayChinese2;
    }
    //</editor-fold>//GEN-END:|42-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlaySpan ">//GEN-BEGIN:|43-getter|0|43-preInit
    /**
     * Returns an initiliazed instance of howToPlaySpan component.
     * @return the initialized component instance
     */
    public Form getHowToPlaySpan() {
        if (howToPlaySpan == null) {//GEN-END:|43-getter|0|43-preInit
            // write pre-init user code here
            howToPlaySpan = new Form("form");//GEN-LINE:|43-getter|1|43-postInit
            // write post-init user code here
        }//GEN-BEGIN:|43-getter|2|
        return howToPlaySpan;
    }
    //</editor-fold>//GEN-END:|43-getter|2|

    //<editor-fold defaultstate="collapsed" desc=" Generated Getter: howToPlaySpan2 ">//GEN-BEGIN:|44-getter|0|44-preInit
    /**
     * Returns an initiliazed instance of howToPlaySpan2 component.
     * @return the initialized component instance
     */
    public Form getHowToPlaySpan2() {
        if (howToPlaySpan2 == null) {//GEN-END:|44-getter|0|44-preInit
            // write pre-init user code here
            howToPlaySpan2 = new Form("form");//GEN-LINE:|44-getter|1|44-postInit
            // write post-init user code here
        }//GEN-BEGIN:|44-getter|2|
        return howToPlaySpan2;
    }
    //</editor-fold>//GEN-END:|44-getter|2|

    /**
     * Returns a display instance.
     * @return the display instance.
     */
    public Display getDisplay() {
        return Display.getDisplay(this);
    }

    class HideToThrowCanvas extends Canvas implements CommandListener {

        private int recHt; // height of words
        private int x, y, xInt; //position of words

        public HideToThrowCanvas() {
            recHt = getHeight() * 30 / 100;
            x = getWidth();
            y = (getHeight() - recHt + recHt / 4);

            xInt = getWidth() / 5;
        }

        public void commandAction(Command command, Displayable displayable) {
            // write pre-action user code here
            if (displayable == startUp) {
                if (command == SplashScreen.DISMISS_COMMAND) {//the first screen
                    // write pre-action user code here
                    switchDisplayable(null, getSelectLanguage());
                    // write post-action user code here
                }
            }
        }

        public void paint(Graphics g) {

            // Display to the language
            if (screenNumber == 1) // screen selectLanguage
            {
                drawString(g);//Select the language
                drawEng(g);//English
                drawSpan(g);//Spanish
                drawPortu(g);//Potuguese
                drawChi(g);//Chinese
            }
            //End of Displaying language

            // Display to choose sound selection on language
            if (screenNumber == 2) // language = english
            {
                drawSound(g); //Enable Sound
                drawYes(g);//Yes
                drawNo(g);//No
            }

            if (screenNumber == 3) { //language == Spanish
                drawSpanSound(g); //Enable Sound
                drawYes(g); //Yes
                drawNo(g); //No
            }

            if (screenNumber == 4) { //language =Potuguese
                drawPortuSound(g); //Enable Sound
                drawYes(g); //Yes
                drawNo(g);//No
            }
            if (screenNumber == 5) { //language =Chinese
                drawChineseSound(g); //Enable Sound
                drawChineseYes(g); //Yes
                drawChineseNo(g); //No
            }
            //End of code display sound selection on different languages


            //Code to display Menu and How to play on differnet languages
            if (screenNumber == 6) { //language is Eng and Go to Menu
                drawMenu(g); //Menu
                drawHowPlay(g); //How to Play
                drawNewGame(g); //New Game
                drawResume(g); //Resume
                drawHighScore(g); //High Score
                drawExit(g); //Exit
            }
            if (screenNumber == 7) {  //How to play in English 1st page
                drawHowToPlay(g);
                drawInstructionsWel(g);
                drawInstruc1(g);
                drawInstruc2(g);
                drawInstruc3(g);
                drawInstruc4(g);
                drawInstruc5(g);
                drawNext(g);
                drawBack(g);
            }

            if (screenNumber == 8) { //How to play in English 2nd page
                drawHowToPlay(g);
                drawInstruc6(g);
                drawInstruc7(g);
                drawInstruc8(g);
                drawInstruc9(g);
                drawInstruc10(g);
                drawInstruc11(g);
                drawBack(g);
                drawBackToMenu(g);
            }
            if (screenNumber == 9) { //language is Spanish and Go to Menu 1st page
                drawMenuSpan(g);
                drawHowPlaySpan(g);
                drawNewGameSpan(g);
                drawResumeSpan(g);
                drawHighScoreSpan(g);
                drawExitSpan(g);
            }

            if (screenNumber == 12) {  // Spanish Instruction 1st page
                drawHowToPlaySpan(g);
                drawSpanWel(g);
                drawSpan1(g);
                drawSpan2(g);
                drawSpan3(g);
                drawSpan4(g);
                drawSpan5(g);
                drawSpan5i(g);
                drawSpanNext(g);
                drawSpanBack(g);
            }
            if (screenNumber == 13) { //Spanish Instructin 2nd page
                drawHowToPlaySpan(g);
                drawSpan6(g);
                drawSpan7(g);
                drawSpan8(g);
                drawSpan9(g);
                drawSpan10(g);
                drawSpan11(g);
                drawSpanBack(g);
                drawSpanBackToMenu(g);
            }
            if (screenNumber == 10) { // Potuguese language and Display Menu
                drawMenuPortu(g);
                drawHowPlayPortu(g);
                drawNewGamePortu(g);
                drawResumePortu(g);
                drawHighScorePortu(g);
                drawExitPortu(g);
            }

            if (screenNumber == 14) { //Potuguese instruction 1st
                drawHowToPlayPortu(g);
                drawPortuWel(g);
                drawPortu1(g);
                drawPortu2(g);
                drawPortu3(g);
                drawPortu4(g);
                drawPortu5(g);
                drawPortuNext(g);
                drawPortuBack(g);
            }

            if (screenNumber == 15) { // Potuguese instruction 2nd
                drawHowToPlayPortu(g);
                drawPortu6(g);
                drawPortu7(g);
                drawPortu8(g);
                drawPortu9(g);
                drawPortu10(g);
                drawPortu11(g);
                drawPortuBack(g);
                drawPortuBackToMenu(g);
            }

            if (screenNumber == 11) { // Display Menu in Chinese
                drawMenuChinese(g);
                drawHowPlayChinese(g);
                drawNewGameChinese(g);
                drawResumeChinese(g);
                drawHighScoreChinese(g);
                drawExitChinese(g);
            }

            if (screenNumber == 16) {  // How to play in Chinese Instruction 1st 
                drawHowToPlayChinese(g);
                drawChineseWel(g);
                drawChinese1(g);
                drawChinese2(g);
                drawChinese3(g);
                drawChinese4(g);
                drawChineseNext(g);
                drawChineseBack(g);
            }

            if (screenNumber == 17) { // How to play in Chinese Instruction 2nd 
                drawHowToPlayChinese(g);
                drawChinese5(g);
                drawChinese6(g);
                drawChinese7(g);
                drawChinese8(g);
                drawChineseBackToMenu(g);
                drawChineseBack(g);
            }
            //End of code to display Menu and Instructions for different languages
        }

        private void drawString(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("Select Language", ((getWidth() / 2) - 60), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSound(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("Enable Sound", ((getWidth() / 2) - 60), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpanSound(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("activar el sonido", ((getWidth() / 2) - 60), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortuSound(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("ativar o som", ((getWidth() / 2) - 60), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChineseSound(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("启用声音", ((getWidth() / 2) - 28), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChineseYes(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("开", ((getWidth() / 2 - 8)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChineseNo(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("关闭", ((getWidth() / 2 - 16)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawYes(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("On", ((getWidth() / 2 - 18)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawNo(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Off", ((getWidth() / 2 - 18)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawEng(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("English", ((getWidth() / 2 - 23)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Espanol", ((getWidth() / 2 - 23)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Portugues", ((getWidth() / 2 - 28)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChi(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("华语", ((getWidth() / 2 - 18)), (getHeight() / 2 + 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawMenu(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("Menu", ((getWidth() / 2) - 25), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawMenuSpan(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("Menú", ((getWidth() / 2) - 25), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawMenuPortu(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("Menu", ((getWidth() / 2) - 25), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawMenuChinese(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("菜单", ((getWidth() / 2) - 25), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowPlay(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("How to Play", ((getWidth() / 2 - 40)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowPlaySpan(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Instrucción", ((getWidth() / 2 - 40)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowPlayPortu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Instrução", ((getWidth() / 2 - 35)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowPlayChinese(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("指令", ((getWidth() / 2 - 25)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawNewGame(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("New Game", ((getWidth() / 2 - 40)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawNewGameSpan(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Juego Nuevo", ((getWidth() / 2 - 45)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawNewGamePortu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Novo jogo", ((getWidth() / 2 - 38)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawNewGameChinese(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("新游戏", ((getWidth() / 2 - 30)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawResume(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Resume", ((getWidth() / 2 - 30)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawResumeSpan(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Resume", ((getWidth() / 2 - 30)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawResumePortu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Salvar", ((getWidth() / 2 - 27)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawResumeChinese(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("恢复", ((getWidth() / 2 - 25)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHighScore(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("High Score", ((getWidth() / 2 - 40)), (getHeight() / 2 + 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHighScoreSpan(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Puntuación alta ", ((getWidth() / 2 - 50)), (getHeight() / 2 + 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHighScorePortu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Pontuação Elevada ", ((getWidth() / 2 - 60)), (getHeight() / 2 + 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHighScoreChinese(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("积分榜", ((getWidth() / 2 - 30)), (getHeight() / 2 + 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawExit(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Exit", ((getWidth() / 2 - 20)), (getHeight() / 2 + 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawExitSpan(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Salir", ((getWidth() / 2 - 20)), (getHeight() / 2 + 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawExitPortu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Saida", ((getWidth() / 2 - 20)), (getHeight() / 2 + 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawExitChinese(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("退出", ((getWidth() / 2 - 22)), (getHeight() / 2 + 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowToPlay(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("How To Play", ((getWidth() / 2) - 100), (getHeight() / 2 - 130), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowToPlaySpan(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("Cómo Jugar", ((getWidth() / 2) - 100), (getHeight() / 2 - 130), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowToPlayPortu(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("Como Jogar", ((getWidth() / 2) - 100), (getHeight() / 2 - 130), Graphics.TOP | Graphics.LEFT);
        }

        private void drawHowToPlayChinese(Graphics g) {
            g.setColor(0X00FFFF);

            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_LARGE));
            g.drawString("如何玩", ((getWidth() / 2) - 100), (getHeight() / 2 - 130), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstructionsWel(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Welcome to HideToThrow Game!", ((getWidth() / 2 - 100)), (getHeight() / 2 - 100), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpanWel(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Bienvenido a HideToThrow Juego!", ((getWidth() / 2 - 100)), (getHeight() / 2 - 100), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortuWel(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Bem-vindo ao Jogo HideToThrow!", ((getWidth() / 2 - 100)), (getHeight() / 2 - 100), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChineseWel(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("欢迎来到HideToThrow游戏!", ((getWidth() / 2 - 100)), (getHeight() / 2 - 100), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc1(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("In this game, your aim is to hit", ((getWidth() / 2 - 100)), (getHeight() / 2 - 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan1(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("En este juego, tu objetivo es", ((getWidth() / 2 - 100)), (getHeight() / 2 - 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu1(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Neste jogo, seu objetivo é bater", ((getWidth() / 2 - 100)), (getHeight() / 2 - 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese1(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("在这个游戏中，你的目标就是达", ((getWidth() / 2 - 100)), (getHeight() / 2 - 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc2(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("your enemy down by choosing", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan2(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("golpear su enemigo por la", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu2(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("o inimigo para baixo, escolhendo", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese2(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("到理想的选择你的武器,", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc3(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("your desirable weapon but at the", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan3(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("elección de su arma deseable,", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu3(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("sua arma desejável, mas na", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese3(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("但同时你的敌人下来,", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc4(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("same time, you will need to", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan4(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("pero en el mismo tiempo, tendrá", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu4(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("mesmo tempo, você vai precisar", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese4(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("你将需要保护自己不被击中.", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc5(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("protect yourself from being hit.", ((getWidth() / 2 - 100)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan5(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("que protegerse contra los", ((getWidth() / 2 - 100)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu5(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("proteger-se de ser atingido.", ((getWidth() / 2 - 100)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan5i(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("choques.", ((getWidth() / 2 - 100)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc6(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("You will be able to pick", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan6(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Usted será capaz de recoger", ((getWidth() / 2 - 100)), (getHeight() / 2 - 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu6(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Você será capaz de escolher", ((getWidth() / 2 - 100)), (getHeight() / 2 - 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese5(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("您将能够在每场比赛挑选", ((getWidth() / 2 - 100)), (getHeight() / 2 - 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc7(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("your choice of weapons in each", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan7(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("su elección de las armas en cada", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu7(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("sua escolha de armas em cada", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese6(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("你的武器选择。在每一个新的", ((getWidth() / 2 - 100)), (getHeight() / 2 - 60), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc8(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("game. In each new level, you", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan8(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("juego. En cada nuevo nivel,", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu8(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("do jogo. Em cada nível novo, você", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese7(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("级别，您将获得国防新血。", ((getWidth() / 2 - 100)), (getHeight() / 2 - 40), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc9(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("will be givenwill be given new blood for", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan9(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Se dará nueva sangre para", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu9(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Será dada sangue novo para", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChinese8(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("级别越高，越难以得到。", ((getWidth() / 2 - 100)), (getHeight() / 2 - 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc10(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("defence. The higher the level,", ((getWidth() / 2 - 100)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan10(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("defensa. Cuanto más alto sea el", ((getWidth() / 2 - 100)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu10(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("defesa. Quanto maior o nível,", ((getWidth() / 2 - 100)), (getHeight() / 2), Graphics.TOP | Graphics.LEFT);
        }

        private void drawInstruc11(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("the more difficult it gets.", ((getWidth() / 2 - 100)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpan11(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("nivel, más difícil se pone.", ((getWidth() / 2 - 100)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortu11(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("mais difícil fica.", ((getWidth() / 2 - 100)), (getHeight() / 2 + 20), Graphics.TOP | Graphics.LEFT);
        }

        private void drawBackToMenu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Menu", ((getWidth() / 2 + 40)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpanBackToMenu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Menú", ((getWidth() / 2 + 40)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortuBackToMenu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Menu", ((getWidth() / 2 + 40)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChineseBackToMenu(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("菜单", ((getWidth() / 2 + 40)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawNext(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Next", ((getWidth() / 2 + 60)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpanNext(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Siguiente", ((getWidth() / 2 + 50)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortuNext(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Seguinte", ((getWidth() / 2 + 50)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChineseNext(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("下一页", ((getWidth() / 2 + 50)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawBack(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Back", ((getWidth() / 2 - 40 - 60)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawSpanBack(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Volver", ((getWidth() / 2 - 40 - 60)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawPortuBack(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("Voltar", ((getWidth() / 2 - 40 - 60)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        private void drawChineseBack(Graphics g) {
            g.setColor(0XFFFFFF);
            g.setFont(Font.getFont(Font.FACE_PROPORTIONAL, Font.STYLE_BOLD, Font.SIZE_MEDIUM));
            g.drawString("返回", ((getWidth() / 2 - 40 - 60)), (getHeight() / 2 + 80), Graphics.TOP | Graphics.LEFT);
        }

        public void pointerReleased(int x, int y) {

            System.out.println("hi");
            System.out.println("Output X:" + x);
            System.out.println("Output Y: " + y);

            //if selectLanguage Screen
            if (screenNumber == 1) {
                if (x < 140 && x > 99 && y < 140 && y > 137) { //English language is shown
                    screenNumber = 2;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getEnableSoundEng());
                    display.setCurrent(canvas);
                    repaint();

                } else if (x < 141 && x > 99 && y < 142 && y > 133) { // Spanish language is shown
                    screenNumber = 3;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getEnableSoundSpan());
                    display.setCurrent(canvas);
                    repaint();

                } else if (x < 153 && x > 92 && y < 181 && y > 174) {//Potugese language is shown
                    screenNumber = 4;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getEnableSoundPortu());
                    display.setCurrent(canvas);
                    repaint();

                } else if (x < 129 && x > 105 && y < 202 && y > 192) { // chinese language is shown
                    screenNumber = 5;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getEnableSoundChinese());
                    display.setCurrent(canvas);
                    repaint();
                }
            }
            //Select language code ended

            //enable sound *to change these code with the sound selection*
            if (screenNumber == 2) {   // Enable sound in English
                if (x < 117 && x > 105 && y < 140 && y > 119) { // Sound On
                    screenNumber = 6; // the menu screen
                    display.setCurrent(canvas);

                    switchDisplayable(null, getMenu());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 121 && x > 106 && y < 161 && y > 152) { // Sound Off
                    screenNumber = 6;// the menu screen
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenu());

                    display.setCurrent(canvas);
                    repaint();
                }
            }
            if (screenNumber == 3) {  // Enable Sound in Spanish
                if (x < 116 && x > 105 && y < 141 && y > 135) { // Sound On
                    screenNumber = 9;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getMenuSpan());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 116 && x > 105 && y < 160 && y > 116) { // Sound Off
                    screenNumber = 9;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getMenuSpan());
                    display.setCurrent(canvas);
                    repaint();
                }
            }
            if (screenNumber == 4) {   // Enable Sound in Potuguese
                if (x < 116 && x > 105 && y < 141 && y > 135) { // Sound On
                    screenNumber = 10;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getMenuPortu());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 117 && x > 104 && y < 161 && y > 153) {  //Sound Off
                    screenNumber = 10;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getMenuPortu());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 5) {  //Enable Sound in Chinese
                if (x < 123 && x > 115 && y < 144 && y > 132) {  //Sound On
                    screenNumber = 11;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getMenuChinese());
                    display.setCurrent(canvas);
                    repaint();

                } else if (x < 129 && x > 109 && y < 160 && y > 154) { // Sound Off
                    screenNumber = 11;
                    display.setCurrent(canvas);

                    switchDisplayable(null, getMenuChinese());
                    display.setCurrent(canvas);
                    repaint();
                }
            }
            // Enable Sound

            //Display the Menu Item
            //Display Menu in English
            if (screenNumber == 6) {
                if (x < 152 && x > 116 && y < 143 && y > 137) {
                    screenNumber = 9; // how to play screen
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenu());
                    display.setCurrent(canvas);
                    repaint();
                }
            }
            //

            //Display Menu in Spanish
            if (screenNumber == 7) {
                if (x < 47 && x > 23 && y < 239 && y > 235) {
                    screenNumber = 6;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenu());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            // Display Menu in Potuguese
            if (screenNumber == 7) {
                if (x < 206 && x > 182 && y < 242 && y > 233) {
                    screenNumber = 8;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlay2());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            ////Display Menu in Chinese
            if (screenNumber == 8) {
                if (x < 46 && x > 23 && y < 239 && y > 236) {
                    screenNumber = 7;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlay());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 8) {
                if (x < 192 && x > 162 && y < 242 && y > 235) {
                    screenNumber = 6;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenu());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 9) {
                if (x < 145 && x > 83 && y < 140 && y > 135) {
                    screenNumber = 12;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlaySpan());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 125 && x > 102 && y < 221 && y > 214) {
                    exitMIDlet();
                }
            }

            if (screenNumber == 10) {
                if (x < 140 && x > 87 && y < 141 && y > 136) {
                    screenNumber = 14;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlayPortu());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 134 && x > 101 && y < 222 && y > 213) {
                    exitMIDlet();
                }
            }

            if (screenNumber == 11) {
                if (x < 122 && x > 99 && y < 143 && y > 132) {
                    screenNumber = 16;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlayChinese());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 125 && x > 100 && y < 221 && y > 210) {
                    exitMIDlet();
                }
            }

            if (screenNumber == 12) {
                if (x < 57 && x > 21 && y < 241 && y > 235) {
                    screenNumber = 9;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenuSpan());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 227 && x > 171 && y < 241 && y > 234) {
                    screenNumber = 13;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlaySpan2());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 13) {
                if (x < 57 && x > 20 && y < 242 && y > 233) {
                    screenNumber = 12;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlaySpan());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 193 && x > 163 && y < 241 && y > 233) {
                    screenNumber = 9;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenuSpan());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 14) {
                if (x < 52 && x > 21 && y < 242 && y > 234) {
                    screenNumber = 10;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenuPortu());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 224 && x > 172 && y < 240 && y > 234) {
                    screenNumber = 15;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlayPortu2());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 15) {
                if (x < 53 && x > 20 && y < 242 && y > 235) {
                    screenNumber = 14;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlayPortu());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 191 && x > 161 && y < 241 && y > 234) {
                    screenNumber = 10;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenuPortu());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 16) {
                if (x < 48 && x > 23 && y < 242 && y > 232) {
                    screenNumber = 11;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenuChinese());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 215 && x > 172 && y < 245 && y > 231) {
                    screenNumber = 17;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlayChinese2());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 17) {
                if (x < 49 && x > 23 && y < 242 && y > 231) {
                    screenNumber = 16;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getHowToPlayChinese());
                    display.setCurrent(canvas);
                    repaint();
                } else if (x < 187 && x > 162 && y < 243 && y > 232) {
                    screenNumber = 11;
                    display.setCurrent(canvas);
                    switchDisplayable(null, getMenuChinese());
                    display.setCurrent(canvas);
                    repaint();
                }
            }

            if (screenNumber == 6) {
                if (x < 120 && x > 104 && y < 219 && y > 215) {
                    exitMIDlet();
                }
            }
            repaint();
        }

        /**
         * Exits MIDlet.
         */
        public void exitMIDlet() {
            switchDisplayable(null, null);
            destroyApp(true);
            notifyDestroyed();
        }

        /**
         * Called when MIDlet is started.
         * Checks whether the MIDlet have been already started and initialize/starts or resumes the MIDlet.
         */
        public void startApp() {
            if (midletPaused) {
                resumeMIDlet();
            } else {
                initialize();
                startMIDlet();
            }
            midletPaused = false;
        }

        /**
         * Called when MIDlet is paused.
         */
        public void pauseApp() {
            midletPaused = true;
        }

        /**
         * Called to signal the MIDlet to terminate.
         * @param unconditional if true, then the MIDlet has to be unconditionally terminated and all resources has to be released.
         */
        public void destroyApp(boolean unconditional) {
        }
    }
}
